package com.yunwei;

import de.greenrobot.daogenerator.DaoGenerator;
import de.greenrobot.daogenerator.Entity;
import de.greenrobot.daogenerator.Schema;

/**
 * Created by weijianxing on 9/14/15.
 */
public class OurDaoGenerator {

    public static void main(String[] args) throws Exception {
        Schema schema = new Schema(1, "com.yunwei.dao");
        addNote(schema);

        String dir = "../GreenDaoDemo/app/src/main/java";
        new DaoGenerator().generateAll(schema, dir);


    }

    private static void addNote(Schema schema) {
        Entity note = schema.addEntity("Note");
        note.addIdProperty();
        note.addStringProperty("text").notNull();
        note.addStringProperty("comment");
        note.addDateProperty("date");
    }
}
